﻿using AiXiu.BLL;
using AiXiu.IBLL;
using AiXiu.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace AiXiu.WebSite
{
    public partial class VideoList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                IVideoManager videoManager = new VideoManager();
                List<TBVideos> videos = videoManager.GetVideos();
                this.gvVideos.DataSource = videos;
                this.gvVideos.DataBind();
            }
        }

        protected void gvVideos_RowDeleting(object sender, GridViewDeleteEventArgs e)
        {
            string videoId = gvVideos.Rows[0].Cells[0].Text;//取出要删除记录的主键值
            //从数据库删除

        }

        protected void gvVideos_RowEditing(object sender, GridViewEditEventArgs e)
        {
            string videoId = gvVideos.Rows[0].Cells[0].Text;//取出要删除记录的主键值
            //跳转页面
            this.Response.Redirect("PersonalEdit.aspx");
        }
    }
}